QQ

您所在的位置:网站首页 qqplot r QQ

QQ

#QQ| 来源: 网络整理| 查看: 265

Pleleminary tasks Example data Create QQ plots Related articles See also Infos

Previously, we described the essentials of R programming and provided quick start guides for importing data into R.

Here, we鈥檒l describe how to create quantile-quantile plots in R. QQ plot (or quantile-quantile plot) draws the correlation between a given sample and the normal distribution. A 45-degree reference line is also plotted. QQ plots are used to visually check the normality of the data.

Pleleminary tasks

Launch RStudio as described here: Running RStudio and setting up your working directory

Prepare your data as described here: Best practices for preparing your data and save it in an external .txt tab or .csv files

Import your data into R as described here: Fast reading of data from txt|csv files into R: readr package.

Example data

Here, we鈥檒l use the built-in R data set named ToothGrowth.

# Store the data in the variable my_data my_data Create QQ plots

The R base functions qqnorm() and qqplot() can be used to produce quantile-quantile plots:

qqnorm(): produces a normal QQ plot of the variable qqline(): adds a reference line qqnorm(my_data$len, pch = 1, frame = FALSE) qqline(my_data$len, col = "steelblue", lwd = 2)

It鈥檚 also possible to use the function qqPlot() [in car package]:

library("car") qqPlot(my_data$len)

As all the points fall approximately along this reference line, we can assume normality.

Related articles Creating and Saving Graphs in R Scatter Plots Scatter Plot Matrices Box Plots Strip Charts: 1-D scatter Plots Bar Plots Line Plots Pie Charts Dot Charts Plot Group Means and Confidence Intervals Graphical Parameters See also Lattice Graphs ggplot2 Graphs Infos

This analysis has been performed using R statistical software (ver. 3.2.4).

Enjoyed this article? I鈥檇 be very grateful if you鈥檇 help it spread by emailing it to a friend, or sharing it on Twitter, Facebook or Linked In.

Show me some love with the like buttons below... Thank you and please don't forget to share and comment below!!

Avez vous aim茅 cet article? Je vous serais tr猫s reconnaissant si vous aidiez 脿 sa diffusion en l'envoyant par courriel 脿 un ami ou en le partageant sur Twitter, Facebook ou Linked In.

Montrez-moi un peu d'amour avec les like ci-dessous ... Merci et n'oubliez pas, s'il vous pla卯t, de partager et de commenter ci-dessous!

Recommended for You! Machine Learning Essentials: Practical Guide in R Practical Guide to Cluster Analysis in R Practical Guide to Principal Component Methods in R R Graphics Essentials for Great Data Visualization Network Analysis and Visualization in R

More books on R and data science Recommended for you

This section contains best data science and self-development resources to help you on your path.

Coursera - Online Courses and SpecializationData scienceCourse: Machine Learning: Master the Fundamentals by StandfordSpecialization: Data Science by Johns Hopkins UniversitySpecialization: Python for Everybody by University of MichiganCourses: Build Skills for a Top Job in any Industry by CourseraSpecialization: Master Machine Learning Fundamentals by University of WashingtonSpecialization: Statistics with R by Duke UniversitySpecialization: Software Development in R by Johns Hopkins UniversitySpecialization: Genomic Data Science by Johns Hopkins UniversityPopular Courses Launched in 2020Google IT Automation with Python by GoogleAI for Medicine by deeplearning.aiEpidemiology in Public Health Practice by Johns Hopkins UniversityAWS Fundamentals by Amazon Web ServicesTrending CoursesThe Science of Well-Being by Yale UniversityGoogle IT Support Professional by GooglePython for Everybody by University of MichiganIBM Data Science Professional Certificate by IBMBusiness Foundations by University of PennsylvaniaIntroduction to Psychology by Yale UniversityExcel Skills for Business by Macquarie UniversityPsychological First Aid by Johns Hopkins UniversityGraphic Design by Cal ArtsBooks - Data ScienceOur BooksPractical Guide to Cluster Analysis in R by A. Kassambara (Datanovia)Practical Guide To Principal Component Methods in R by A. Kassambara (Datanovia)Machine Learning Essentials: Practical Guide in R by A. Kassambara (Datanovia)R Graphics Essentials for Great Data Visualization by A. Kassambara (Datanovia)GGPlot2 Essentials for Great Data Visualization in R by A. Kassambara (Datanovia)Network Analysis and Visualization in R by A. Kassambara (Datanovia)Practical Statistics in R for Comparing Groups: Numerical Variables by A. Kassambara (Datanovia)Inter-Rater Reliability Essentials: Practical Guide in R by A. Kassambara (Datanovia)OthersR for Data Science: Import, Tidy, Transform, Visualize, and Model Data by Hadley Wickham & Garrett GrolemundHands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems by Aurelien G茅ronPractical Statistics for Data Scientists: 50 Essential Concepts by Peter Bruce & Andrew BruceHands-On Programming with R: Write Your Own Functions And Simulations by Garrett Grolemund & Hadley WickhamAn Introduction to Statistical Learning: with Applications in R by Gareth James et al.Deep Learning with R by Fran莽ois Chollet & J.J. AllaireDeep Learning with Python by Fran莽ois Chollet Want to Learn More on R Programming and Data Science?

Follow us by Email

On Social Networks:

 Get involved :   Click to follow us on Facebook and Google+ :      Comment this article by clicking on "Discussion" button (top-right position of this page) This page has been seen 560628 times


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3